#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.60])
AC_INIT([dnsproxy], [0.5], [fandingjun@gmail.com])
AC_CONFIG_SRCDIR([src/dnsproxy.h])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_CANONICAL_HOST
AM_PROG_CC_C_O
AC_PROG_RANLIB
#AC_DISABLE_SHARED
#AC_PROG_LIBTOOL
AM_INIT_AUTOMAKE(1.0)
#LT_PREREQ([2.2])
#LT_INIT([dlopen])
# Checks for libraries.
#PKG_CHECK_MODULES([GLIB],[glib-2.0],[found_glib=yes],[found_glib=no])
#PKG_CHECK_MODULES([GIO],[gio-2.0])
#AS_IF([test "xfound_glib" = "xno"],[AC_MSG_ERROR([***glib not found***])])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
AC_CHECK_HEADERS([sys/select.h getopt.h stdio.h ctype.h])
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T

# Checks for library functions.
#AC_FUNC_MALLOC
AC_CHECK_FUNCS([inet_ntoa inet_ntop memset select socket strcasecmp strchr strdup])

case "$host" in
    *mingw*)
    os_win32=yes
        ;;
    *)
    os_win32=no
        ;;
esac
AM_CONDITIONAL(WIN32,[test x"$os_win32" = x"yes"])

AC_CONFIG_FILES([
                 Makefile
                 src/Makefile])
AC_OUTPUT

